const obj = {
    a: 1,
    b: 2,
    c: 3
}

function fn(obj) {
    for(let key in obj) {
        console.log(obj[key])
    }
}

fn(obj)


const keys = Object.keys(obj)
keys.forEach(key => {
    console.log(key, obj[key])
})

const entrys = Object.entries(obj)
console.log(entrys)
entrys.forEach(([key, value]) => {
    console.log(key, value)
})

console.log(Reflect.ownKeys(obj))  //Reflect获取到所有的key
Reflect.ownKeys(obj).forEach(key => {
    console.log(key, obj[key])
})
